package com.itheima.stream;

import java.util.*;
import java.util.stream.Stream;

/*
获取流
单列集合 .stream();
双列集合  .keySet().stream()
           .entrySet().stream()
数组      Arrays.stream();
多个同种类型的数据    Stream.of()
 */
public class Demo01 {
    public static void main(String[] args) {

        ArrayList<String> list2 = new ArrayList<>(List.of("坤坤1", "坤坤2", "坤坤3", "坤坤4"));
        //System.out.println(list2);
        list2.stream().forEach(s-> System.out.println(s));
        TreeSet<Integer> set = new TreeSet<>(Set.of(1, 11, 22, 33, 44, 55));
       // System.out.println(set);
        set.stream().forEach(i-> System.out.println(i));

        HashMap<String, Integer> map = new HashMap<>(Map.of("坤坤", 2,"坤坤23", 2, "小璐", 3));
      //  System.out.println(map);
        map.keySet().stream().forEach(k-> System.out.println(k));
        HashMap<String, String> map2 = new HashMap<>(Map.ofEntries(Map.entry("坤坤", "i坤"), Map.entry("小鹿", "i鹿")));
    //    System.out.println(map2);

        map2.entrySet().stream().forEach(entry-> System.out.println(entry));
        int[] arr= {11,22,33,44,55};
        Arrays.stream(arr).forEach(i-> System.out.println(i));


        Stream.of("坤坤","小璐","签签","滔滔").forEach(s-> System.out.println(s));
    }

}
